package com.bwie.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.github.classgraph.json.Id;
import io.swagger.models.auth.In;
import lombok.Data;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

@Data
@Document(indexName = "es_student",shards = 1,replicas = 0)
public class Student {
    @Id
    @Field(type = FieldType.Keyword)
    private Integer stuId;
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String stuName;
    @Field(type = FieldType.Integer)
    private Integer age;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @Field(type = FieldType.Date,format = DateFormat.custom,pattern = "yyyy-MM-dd HH:mm:ss")
    private Date stuTime;
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String clazz;
}
